import request from '@/utils/request'

//***************角色相关接口*************************


//获取所有角色[分页]
export function getAllRolesWithPage(pageParams) {
  return request({
    url: '/watchdog/roles',
    params: pageParams
  })
}

//获取所有角色[不分页】
export function getAllRoles() {
  return request({
    url: '/watchdog/roles',
    params: {
      select_type: 'all'
    }
  })
}

//更新角色信息
export function updateRole(role) {
  return request({
    url: '/watchdog/roles',
    method: 'put',
    data: role
  })
}

//添加新角色
export function addRole(role) {
  return request({
    url: '/watchdog/roles',
    method: 'post',
    data: role
  })
}

//删除角色
export function deleteRoleById(id) {
  return request({
    url: '/watchdog/roles',
    method: 'delete',
    params: {
      id: id
    }
  })
}
